package com.zy.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.entity.PricingStandard;
import com.zy.mapper.PricingStandardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class PricingStandardService extends ServiceImpl<PricingStandardMapper, PricingStandard> {

    PricingStandardMapper mapper;
    @Autowired
    public PricingStandardService(PricingStandardMapper mapper){
        this.mapper=mapper;
    }

    public List<PricingStandard> getAll() {
        List<PricingStandard> entities=mapper.selectList(null);
        return entities;
    }


    public PricingStandard getById(Long id) {
        PricingStandard entity=mapper.selectById(id);
        return entity;
    }


    public boolean insert(PricingStandard entity) {
        int result=mapper.insert(entity);
        return result > 0;
    }


    public boolean update(PricingStandard entity) {
        int result= mapper.updateById(entity);
        return result>0?true:false;
    }


    public boolean delete(Long id) {
       int result=mapper.deleteById(id);
        return result>0?true:false;
    }


    public String getSalt() {
        return null;
    }


    public String encryptPassword(String password, String salt) {
        return null;
    }


    public boolean validatePassword(String password, String encryptPassword, String salt) {
        return false;
    }
}
